home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir43
/
qsrc_dsk.zip
/
MODEL
/
CHKCODE.PRG
< prev
next >
Wrap
Text File
|
1991-12-17
|
2KB
|
67 lines
* ╓─────────────────────────────────────────────────────────╖
* ║ ║
* ║ CHKCODE.PRG ║
* ║ ║
* ╟─────────────────────────────────────────────────────────╢
* ║ Application Developed in _Using FoxPro 2_ ║
* ║ ║
* ║ Lisa C. Slater and Steven E. Arnott ║
* ║ ║
* ║ Copyright (c) 1991 Que Publishing ║
* ║ ║
* ╙─────────────────────────────────────────────────────────╜
the_code = VARREAD()
* store the name of the variable being READ
IF EMPTY(EVALUATE("m."+the_code))
* check to see if the variable is empty
* using "m." again to distinguish the variable
* from a field of the same name
RETURN .F.
ENDIF
IF RECCOUNT() = 0
RETURN .T.
ENDIF
mcode = EVALUATE("m."+the_code)
* store the contents of the variable
mreturn = .T.
mrec = IIF(EOF(),0,RECNO())
morder = ORDER()
SET ORDER TO (the_code)
* reference the name of the variable
* to set the order
IF SEEK(mcode) AND (addmode OR RECNO() # mrec)
* if we are trying to add a record
* NO record in the database should
* have this code, regardless of what
* record we're on in the database
* when we're NOT adding, a record with
* a different record number than mrec
* represents a problem, as it did before
mreturn = .F.
ENDIF
SET ORDER TO (morder)
IF mrec = 0
* we're at the End-of-File marker, not a
* regular record
GO BOTTOM
SKIP
ELSE
GO mrec
ENDIF
RETURN mreturn